#pragma once

#include "AbstractRender.h"
#include "BasicCamera.h"
#include "Shape.h"
#include "ShapeLibrary.h"
#include "Texture.h"
#include "TextureLibrary.h"
#include "ShaderPairLibrary.h"

#include "Model.h"

// describes the constant buffer that will be used to draw the cube


ref class SpinningCubeRender : public AbstractRender
{
internal :
    SpinningCubeRender();

    virtual void CreateDeviceIndependentResources() override;
    virtual void CreateDeviceResources() override;
    virtual void CreateWindowSizeDependentResources() override;
    virtual void Render() override;
    virtual void Update(float timeTotal, float timeDelta) override;

private:
  
    ID3D11SamplerState*          m_sampler;                    // cube texture sampler
    ID3D11Buffer*                m_constantBuffer;             // constant buffer resource

    ModelViewProjectionConstantBuffer           m_modelViewProjection;          // constant buffer resource data
    BasicCamera*             m_camera;                      // scene camera

	float4x4 modelTransform;

	// models used in the renderer
	Shape* cube;
	Texture *texture;
	ShaderPair* shaderPair;

	Model *cubeModel;

	ShapeLibrary *shapes;
	TextureLibrary* textures;
	ShaderPairLibrary* shaderPairs;
};